package com.sky.mapper.user;

import com.sky.pojo.OrderDetail;
import com.sky.vo.OrderDetailVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Description OrderDetailMapper
 * @Author lyh
 * @Date 2024-10-11
 */
@Mapper
public interface OrderDetailMapper {
    void saveBeach(@Param("orderDetailList") List<OrderDetail> orderDetailList);
    @Select("select * from order_detail where order_id=#{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);
    @Select("select od.name,od.number from order_detail od left join orders o on  od.order_id=o.id\n" +
            "where o.number=#{orderNumber}")
    List<OrderDetailVO> selectByOrderNumber(String orderNumber);
}
